package com.book.common.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
@ComponentScan
@Component
class WebConfigurer extends WebMvcConfigurerAdapter {
    @Autowired
    BootdoConfig bootdoConfig;
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//		registry.addResourceHandler("/img/**").addResourceLocations("file:///"+bootdoConfig.getUploadPath());
        registry.addResourceHandler("/img/iphone/**").addResourceLocations("file:F:/WEB/book/" + bootdoConfig.getUploadPath());
        super.addResourceHandlers(registry);

    }

}